package com.ecoolex.hotel.saas.core.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.ecoolex.framework.common.pojo.Page;
import com.ecoolex.hotel.saas.core.mapper.PresaleCouponMapper;
import com.ecoolex.hotel.saas.entity.PresaleCoupon;

public interface PresaleCouponDAO extends PresaleCouponMapper {
	
	Long count(@Param("name") String name, 
		@Param("storeId") Integer storeId, 
		@Param("categoryId") Integer categoryId,
		@Param("status") Integer status);
	
	List<PresaleCoupon> query(@Param("name") String name, 
		@Param("storeId") Integer storeId, 
		@Param("categoryId") Integer categoryId, 
		@Param("status") Integer status,
		@Param("page") Page page);
	
	Integer addUsedStockNumber(@Param("preCouponId") Integer preCouponId, 
		@Param("buyNumber") Integer buyNumber, 
		@Param("updateUser") String updateUser);
	
	Integer subtractUsedStockNumber(@Param("preCouponId") Integer preCouponId, 
		@Param("buyNumber") Integer buyNumber, 
		@Param("updateUser") String updateUser);
	
	Integer addSaleNumber(@Param("preCouponId") Integer preCouponId, 
		@Param("buyNumber") Integer buyNumber, 
		@Param("updateUser") String updateUser);
}